<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>CURLOPT_PROXY man page</title>
<meta name="generator" content="roffit">
<STYLE type="text/css">
pre {
  overflow: auto;
  margin: 0;
}

P.level0, pre.level0 {
 padding-left: 2em;
}

P.level1, pre.level1 {
 padding-left: 4em;
}

P.level2, pre.level2 {
 padding-left: 6em;
}

span.emphasis {
 font-style: italic;
}

span.bold {
 font-weight: bold;
}

span.manpage {
 font-weight: bold;
}

h2.nroffsh {
 background-color: #e0e0e0;
}

span.nroffip {
 font-weight: bold;
 font-size: 120%;
 font-family: monospace;
}

p.roffit {
 text-align: center;
 font-size: 80%;
}
</STYLE>
</head><body>

<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
<p class="level0">CURLOPT_PROXY - set proxy to use <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
<p class="level0">&#35;include &lt;curl/curl.h&gt; 
<p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY, char *proxy); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
<p class="level0">Set the <span Class="emphasis">proxy</span> to use for the upcoming request. The parameter should be a char * to a zero terminated string holding the host name or dotted numerical IP address. A numerical IPv6 address must be written within [brackets]. 
<p class="level0">To specify port number in this string, append :[port] to the end of the host name. The proxy's port number may optionally be specified with the separate option <a Class="emphasis" href="./CURLOPT_PROXYPORT.html">CURLOPT_PROXYPORT</a>. If not specified, libcurl will default to using port 1080 for proxies. 
<p class="level0">The proxy string may be prefixed with [scheme]:// to specify which kind of proxy is used. Use socks4://, socks4a://, socks5:// or socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as <span Class="emphasis">CURLPROXY_SOCKS5_HOSTNAME</span> type) to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. 
<p class="level0">Without a scheme prefix, <a Class="emphasis" href="./CURLOPT_PROXYTYPE.html">CURLOPT_PROXYTYPE</a> can be used to specify which kind of proxy the string identifies. 
<p class="level0">When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as <a Class="emphasis" href="./CURLOPT_QUOTE.html">CURLOPT_QUOTE</a> and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with <a Class="emphasis" href="./CURLOPT_HTTPPROXYTUNNEL.html">CURLOPT_HTTPPROXYTUNNEL</a>. 
<p class="level0">libcurl respects the environment variables <span Class="bold">http_proxy</span>, <span Class="bold">ftp_proxy</span>, <span Class="bold">all_proxy</span> etc, if any of those are set. The <a Class="emphasis" href="./CURLOPT_PROXY.html">CURLOPT_PROXY</a> option does however override any possibly set environment variables. 
<p class="level0">Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. 
<p class="level0">A proxy host string can also include protocol scheme (http://) and embedded user + password. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
<p class="level0">Default is NULL, meaning no proxy is used. 
<p class="level0">When you set a host name to use, do not assume that there's any particular single port number used widely for proxies. Specify it! <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
<p class="level0">All except file://. Note that some protocols don't do very well over proxy. <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
<p class="level0">TODO <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
<p class="level0">Since 7.14.1 the proxy environment variable names can include the protocol scheme. 
<p class="level0">Since 7.21.7 the proxy string supports the socks protocols as "schemes". <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
<p class="level0">Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
<p class="level0"><a Class="manpage" href="./CURLOPT_PROXYPORT.html">CURLOPT_PROXYPORT</a>, <a Class="manpage" href="./CURLOPT_HTTPPROXYTUNNEL.html">CURLOPT_HTTPPROXYTUNNEL</a>, <a Class="manpage" href="./CURLOPT_PROXYTYPE.html">CURLOPT_PROXYTYPE</a><p class="roffit">
 This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
</body></html>
